﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyOA.DAL;
using MyOA.Model;

namespace MyOA.BLL
{
    public class UserInfoManager
    {
        UserInfoService userInfoService = new UserInfoService();
        //查找所有UserInfo信息
        public IList<UserInfo> GetAllUserInfo()
        {
            return userInfoService.GetAllUserInfo();
        }
        //根据userId查找UserInfo信息
        public UserInfo GetUserInfoByUserId(int userId)
        {
            return userInfoService.GetUserInfoByUserId(userId);
        }
        //*根据DepartId查找UserInfo
        public int GetCountUserInfoByDepartId(int departId)
        {
            return userInfoService.GetCountUserInfoByDepartId(departId);
        }
        //根据LoginId查找UserInfo信息
        public UserInfo GetUserInfoByLoginId(string loginId)
        {
            return userInfoService.GetUserInfoByLoginId(loginId);
        }
        //根据UserId修改UserInfo信息
        public int UpdateUserInfoByUserId(UserInfo userInfo)
        {
            return userInfoService.UpdateUserInfoByUserId(userInfo);
        }
        //根据UserId删除UserInfo信息
        public int DeleteUserInfoByuserId(int userId)
        {
            return userInfoService.DeleteUserInfoByuserId(userId);
        }
        //添加userInfo信息
        public int AddUserInfo(UserInfo userInfo)
        {
            return userInfoService.AddUserInfo(userInfo);
        }
        /// <summary>
        /// 根据messageId查找所有收信人
        /// </summary>
        /// <param name="messageId">收信人收到的信息Id</param>
        /// <returns>所有收信人</returns>
        public IList<UserInfo> getAllUserInfoByMessageId(int messageId)
        {
            return userInfoService.getAllUserInfoByMessageId(messageId);
        }
        /// <summary>
        /// 根据departId查找该机构的所有用户
        /// </summary>
        /// <param name="departId">机构Id</param>
        /// <returns>用户集合</returns>
        public IList<UserInfo> getAllUserInfoByDepartId(int departId)
        {
            return userInfoService.getAllUserInfoByDepartId(departId);
        }
    }
}
